<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>用户列表</title>
  <link rel="stylesheet" href="/admin/assets/lib/layui/css/layui.css">
  <link rel="stylesheet" href="/admin/assets/css/user.css">
</head>
<body>
  <div class="layui-card">
    <div class="layui-card-header">卡片面板</div>
    <div class="layui-card-body">
      <table class="layui-table">
        <colgroup>
          <col width="5%">
          <col width="20%">
          <col width="15%">
          <col width="15%">
          <col width="200%">
          <col>
        </colgroup>
        <thead>
          <tr>
            <th>ID</th>
            <th>账号名称</th>
            <th>昵称</th>
            <th>邮箱</th>
            <th>操作</th>
          </tr> 
        </thead>
        <tbody id="contents">
          
        </tbody>
      </table>
      <div id="test1"></div>
    </div>
  </div>

  <script type="text/html" id="table">
    <!-- i 表示每一项 -->
    {{each data v}}
    <tr>
      <td>{{v.id}}</td>
      <td>{{v.username}}</td>
      <td>{{v.nickname}}</td>
      <td>{{v.email}}</td>
      <td>
        <button type="button" id='edit' data-id={{v.id}} class="layui-btn  layui-btn-xs">
          编辑
        </button>
        <button type="button" id='del' data-id={{v.id}} class="layui-btn  layui-btn-danger layui-btn-xs">删除</button>
        <button type="button" id="resetPwd" data-id={{v.id}} class="layui-btn  layui-btn-normal layui-btn-xs">重置密码</button>
      </td>
    </tr>
    {{/each}}
  </script>
  <script type="text/html" id="changePwd">
    <form id='chePwd' class="layui-form" action="" lay-filter="form" >
      <div class="layui-form-item">
        <label class="layui-form-label">密码</label>
        <div class="layui-input-block">
          <input type="text" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off"
            class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">确认密码</label>
        <div class="layui-input-block">
          <input type="text" name="reusername" required lay-verify="required" placeholder="请重复输入密码" autocomplete="off"
            class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button class="layui-btn" lay-submit lay-filter="formDemo">提交</button>
          <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
      </div>
    </form>
  </script>

  <script type="text/html" id="aEdit">
    <form id='editPwd' class="layui-form" action="" lay-filter="formTest" >
      <div class="layui-form-item">
        <label class="layui-form-label">用户名</label>
        <div class="layui-input-block">
          <input type="text" name="username" required lay-verify="required" placeholder="请用户名" autocomplete="off"
            class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">昵称</label>
        <div class="layui-input-block">
          <input type="text" name="nickname" required lay-verify="required" placeholder="请昵称" autocomplete="off"
            class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">邮箱</label>
        <div class="layui-input-block">
          <input type="text" name="email" required lay-verify="required" placeholder="请输入邮箱" autocomplete="off"
            class="layui-input">
            <!-- 需要id添加一个id -->
          <input type="text" name="id" required lay-verify="required" placeholder="请输入邮箱" autocomplete="off"
            class="layui-input" style='display:none'>
        </div>
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button class="layui-btn" lay-submit lay-filter="formDemo">提交</button>
          <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
      </div>
    </form>
  </script>

  <script src="/admin/assets/lib/layui/layui.all.js"></script>
  <script src="/admin/assets/lib/jquery.js"></script>
  <script src="/admin/assets/lib/template-web.js"></script>
  <script src="/admin/assets/js/comment/comment.js"></script>
  <script src="/admin/assets/js/user/user.js"></script>
  <script src="/admin/assets/js/user/edit.js"></script>
</body>
</html>